package com.ece.demo.controller.commands.charactor;

import com.bulletphysics.dynamics.character.KinematicCharacterController;
import com.bulletphysics.linearmath.Transform;

import dev.ece.core.engine.Engine;
import dev.ece.suit.loader.Sprite3D;
import dev.ece.util.lib.Vector3f;
import dev.ece.util.tools.Camera;

/**
 * @author 潜行的青衣
 * @see
 */
public class SpriteMoveLeftCommand extends SpriteMoveCommand {

	

	public SpriteMoveLeftCommand(Sprite3D<Float> sprite, KinematicCharacterController controller, Camera camera,
			float speed) {
		super(sprite, controller, camera, speed);
	}

	/* (non-Javadoc)
	 * @see com.ece.demo.controller.commands.sprite.SpriteMoveCommand#getDirVector()
	 */
	@Override
	public Vector3f getDirVector() {
		float distance =  Engine.currentTimer().getDalyTime() * this.getSpeed();
		Transform transform = new Transform();
		this.getSprite().getJbulletTransformation().getCollisionObject().getWorldTransform(transform);
		transform.basis.rotY((float) Math.toRadians(90));
		this.getSprite().getJbulletTransformation().getCollisionObject().setWorldTransform(transform);
		return new Vector3f(-distance, 0, 0);
	}

}
